﻿using System;

namespace Plugins.FormicArch.Core
{
    public class FAEventManager
    {
       
        // 注册事件（支持 1 到 5 个参数）
        public static void Register(PubliceEventType publiceEventType, object handler) =>
            FAEventSingleManager<PubliceEventType>.Register(publiceEventType, handler);
        public static void Register(PubliceEventType publiceEventType, Action handler) =>
            FAEventSingleManager<PubliceEventType>.Register(publiceEventType, handler);
        public static void Register<T>(PubliceEventType publiceEventType, Action<T> handler) =>
            FAEventSingleManager<PubliceEventType>.Register(publiceEventType, handler);

        public static void Register<T1, T2>(PubliceEventType publiceEventType, Action<T1, T2> handler) =>
            FAEventSingleManager<PubliceEventType>.Register(publiceEventType, handler);

        public static void Register<T1, T2, T3>(PubliceEventType publiceEventType, Action<T1, T2, T3> handler) =>
            FAEventSingleManager<PubliceEventType>.Register(publiceEventType, handler);

        public static void Register<T1, T2, T3, T4>(PubliceEventType publiceEventType, Action<T1, T2, T3, T4> handler) =>
            FAEventSingleManager<PubliceEventType>.Register(publiceEventType, handler);

        public static void Register<T1, T2, T3, T4, T5>(PubliceEventType publiceEventType, Action<T1, T2, T3, T4, T5> handler) =>
            FAEventSingleManager<PubliceEventType>.Register(publiceEventType, handler);

        // 取消注册事件（支持 1 到 5 个参数）
        public static void Unregister(PubliceEventType publiceEventType, object handler) =>
            FAEventSingleManager<PubliceEventType>.Unregister(publiceEventType, handler);
        public static void Unregister(PubliceEventType publiceEventType, Action handler) =>
            FAEventSingleManager<PubliceEventType>.Unregister(publiceEventType, handler);
        public static void Unregister<T>(PubliceEventType publiceEventType, Action<T> handler) =>
            FAEventSingleManager<PubliceEventType>.Unregister(publiceEventType, handler);

        public static void Unregister<T1, T2>(PubliceEventType publiceEventType, Action<T1, T2> handler) =>
            FAEventSingleManager<PubliceEventType>.Unregister(publiceEventType, handler);

        public static void Unregister<T1, T2, T3>(PubliceEventType publiceEventType, Action<T1, T2, T3> handler) =>
            FAEventSingleManager<PubliceEventType>.Unregister(publiceEventType, handler);

        public static void Unregister<T1, T2, T3, T4>(PubliceEventType publiceEventType, Action<T1, T2, T3, T4> handler) =>
            FAEventSingleManager<PubliceEventType>.Unregister(publiceEventType, handler);

        public static void Unregister<T1, T2, T3, T4, T5>(PubliceEventType publiceEventType, Action<T1, T2, T3, T4, T5> handler) =>
            FAEventSingleManager<PubliceEventType>.Unregister(publiceEventType, handler);

        // 触发事件（支持 1 到 5 个参数）
        public static void Trigger(PubliceEventType publiceEventType) => FAEventSingleManager<PubliceEventType>.Trigger(publiceEventType);
        public static void Trigger<T>(PubliceEventType publiceEventType, T arg) => FAEventSingleManager<PubliceEventType>.Trigger(publiceEventType, arg);

        public static void Trigger<T1, T2>(PubliceEventType publiceEventType, T1 arg1, T2 arg2) =>
            FAEventSingleManager<PubliceEventType>.Trigger(publiceEventType, arg1, arg2);

        public static void Trigger<T1, T2, T3>(PubliceEventType publiceEventType, T1 arg1, T2 arg2, T3 arg3) =>
            FAEventSingleManager<PubliceEventType>.Trigger(publiceEventType, arg1, arg2, arg3);

        public static void Trigger<T1, T2, T3, T4>(PubliceEventType publiceEventType, T1 arg1, T2 arg2, T3 arg3, T4 arg4) =>
            FAEventSingleManager<PubliceEventType>.Trigger(publiceEventType, arg1, arg2, arg3, arg4);


        public static void
            Trigger<T1, T2, T3, T4, T5>(PubliceEventType publiceEventType, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) =>
            FAEventSingleManager<PubliceEventType>.Trigger(publiceEventType, arg1, arg2, arg3, arg4, arg5);
    }
}